package com.itheima.demo;

import com.itheima.domain.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");
        User u = ac.getBean("user",User.class);//如果spring中的id只有一个,括号内可以不写id名

    }
}
